home *** CD-ROM | disk | FTP | other *** search
/ s-gikan2.maizuru-ct.ac.jp / s-gikan2.maizuru-ct.ac.jp.zip / s-gikan2.maizuru-ct.ac.jp / pub / old / ncvc350_install.exe / {app} / scripts / add_point.pl < prev    next >
Perl Script  |  2004-04-02  |  823b  |  32 lines

  1. #! /usr/bin/perl
  2.  
  3. #  É▌ÆΦé╡é╜ò╢ÄÜâRü[âhé╠ăé╠ÉöÄÜé╔żÉöô_é≡òtë┴é╖éΘâXâNâèâvâg  #
  4. #  é╜é╛é╡üA0é╔é═òtë┴é╡é╚éó                                   #
  5. #  ex.X50 -> X50. , X0 -> X0                                 #
  6.  
  7. #####################################################
  8. #żÉöô_é≡òtë┴é╡é╜éóò╢ÄÜâRü[âhé≡ÿAæ▒é┼ôⁿéΩé─é¡é╛é│éó
  9. #ex. XYZIJR
  10. $add_code= 'XYZIJR';
  11. #####################################################
  12.  
  13. $pre_file= $ARGV[0];
  14. $out_file= $ARGV[1];
  15. open(IN,$pre_file);
  16. open(OUT,">$out_file");
  17.  
  18. while(<IN>){
  19.     if(!/^N?[0-9\s]*[\(\%]/){
  20.         $new_line= "";
  21.         while(/([$add_code])([\-\d\.]+)/){
  22.             ($pre_line,$char,$num,$_)= ($`,$1,$2,$');
  23.             if($num !~ /\./ and $num != 0){ $num= $num."\."; }
  24.             $new_line= $new_line.$pre_line.$char.$num;
  25.         }
  26.         $_= $new_line.$_;
  27.     }
  28.     print OUT;
  29. }
  30. close(OUT);
  31. close(IN);
  32.